package com.os.opencv.java.chapter4;

import org.opencv.core.Core;
import org.opencv.core.Mat;
import org.opencv.highgui.HighGui;
import org.opencv.imgcodecs.Imgcodecs;

public class BitwiseNot {

    public static void main(String[] args) {
        System.loadLibrary(Core.NATIVE_LIBRARY_NAME);

        //读取图像文件并在屏幕上显示
        Mat src = Imgcodecs.imread("/Users/matt/MATT-MAC/matt_workspace/OS-OpenCV_workspace/test.jpg");
        HighGui.imshow("src", src);
        HighGui.waitKey(0);

        //取饭操作获得底片效果
        Mat dst = new Mat();
        Core.bitwise_not(src, dst);

        //在屏幕上显示底片效果
        HighGui.imshow("negative", dst);
        HighGui.waitKey(0);

        System.exit(0);
    }
}
